package com.lsu.medium.experiment;

/**
 * 卖方
 *
 * @Author wang suo
 * @Date 2020/11/27 0027 15:55
 * @Version 1.0`
 */
class Seller extends Customer {
    private static final long serialVersionUID = -1443076716629516027L;

    public Seller(String name) {
        super(name);
        clientWindow(50, 100);
    }

    @Override
    public void send(String ad) {
        receiveArea.append("我(卖方)说: " + ad + "\n");
        //使滚动条滚动到最底端
        receiveArea.setCaretPosition(receiveArea.getText().length());
        estateMedium.relay(name, ad);
    }

    @Override
    public void receive(String from, String ad) {
        receiveArea.append(from + "说: " + ad + "\n");
        //使滚动条滚动到最底端
        receiveArea.setCaretPosition(receiveArea.getText().length());
    }
}
